﻿namespace NET6.WebAPI.Dtos.Tool
{
    /// <summary>
    /// 分页输出模型
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class PagingDto<T> where T : class
    {
        /// <summary>
        /// 总行数
        /// </summary>
        public int TotalCount { get; set; }

        /// <summary>
        /// 总页数
        /// </summary>
        public int TotalPage { get; set; }

        /// <summary>
        /// 分页数据
        /// </summary>
        public object Datas { get; set; }

        public PagingDto() { }

        public PagingDto(int totalCount, int pageSize, object datas)
        {
            TotalCount = totalCount;
            TotalPage = (int)Math.Ceiling((double)totalCount / pageSize);
            Datas = datas;
        }
    }
}
